package com.jinhua.huaojcodesandbox.exception;

import com.jinhua.huaojcodesandbox.model.ExecuteCodeResponse;
import com.jinhua.huaojcodesandbox.model.JudgeInfo;
import com.jinhua.huaojcodesandbox.model.enums.QuestionSubmitStateEnum;

/**
 * 返回工具类
 *
 * 
 * 
 */
public class ResultUtils {


    /**
     *
     * @return
     */
    public static ExecuteCodeResponse error(String message) {
        ExecuteCodeResponse executeCodeResponse = new ExecuteCodeResponse();
        JudgeInfo judgeInfo = new JudgeInfo();
        judgeInfo.setMessage(message);
        executeCodeResponse.setState(QuestionSubmitStateEnum.FAIL.getValue());
        executeCodeResponse.setOutputList(null);
        executeCodeResponse.setExcuteInfo(judgeInfo);

        return executeCodeResponse;
    }

}
